package org.peterf.foxish.opengl20;

import org.peterf.foxish.R;
import org.peterf.foxish.util.EngineException;

import android.app.ActivityManager;
import android.content.Context;

/**
 * Collect OpenGL information for further use.
 * 
 * @author peter
 * 
 */
public class OpenGLInfo {

    private static Context context;

    private static int openGLVersion;

    public static void setContext(Context context) {
        OpenGLInfo.context = context;
        ensureOpenGL20();
        gatherInfo();
    }

    private static void ensureOpenGL20() {
        ActivityManager manager = (ActivityManager) context
                .getSystemService(Context.ACTIVITY_SERVICE);
        openGLVersion = manager.getDeviceConfigurationInfo().reqGlEsVersion;
        if (openGLVersion <= 0x2000) {
            throw new EngineException(R.string.foxish_err_no_gles20);
        }
    }

    private static void gatherInfo() {
        // TODO
    }

}
